
public class MainMemory {

	private String[] mainMemory;
	private int memoryIndex = 0;
	
	public MainMemory(){
		
		mainMemory = new String[256];
	}
	
	public String[] getMainMemory(){
		return mainMemory;
	}
	
	public void setMainMemory(String[] nMainMemory){
		mainMemory = nMainMemory;
	}
	
	public String getDataAtIndex(int index){
		return mainMemory[index];
	}
	
	public void insertData(String data){
		 
		String littleEndian = data.substring(2);
		String bigEndian = data.substring(0, 2);
		
		mainMemory[memoryIndex] = bigEndian;
		memoryIndex++;
		mainMemory[memoryIndex] = littleEndian;
		memoryIndex++;
	}
	
	public void insertDataAtIndex(String data, int index){
		mainMemory[index] = data;
	}
	
	
	public int memorySize(){
		return mainMemory.length;
	}
	
	
	
	
	
}
